home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / a / a_funk / wettrfax.tos / FAX / WEFAX / WEFAXON4.SOU < prev    next >
Encoding:
Text File  |  1995-04-30  |  22.4 KB  |  1,041 lines

  1. * 24Feb91/0114 Subject: wefax prg part 1 of 6 Bulletin ID: 4158_ON4ASX
  2. * Path: DB0CZ!OE9XPI!HB9EAS!DB0GE!LX0PAC!ON7RC!ON4HU!ON4ASX
  3. * From: ON4ASX@ON4ASX.BVWV.BEL.EU   To  : ATARI@EU
  4. *
  5. *----------------------------------*
  6. * Atari ST Wefax Picture receiver  *
  7. * (c) Antic Publishing             *
  8. * Version 060586     --Thursday    *
  9. * Written by Patrick Bass          *
  10. *                                  *
  11. * For Atari ST Computers Only!     *
  12. *----------------------------------*
  13.  
  14. GEMDOS    equ       1
  15. BIOS      equ       13
  16. XBIOS     equ       14
  17.  
  18. Physbase  equ       2
  19. Getrez    equ       4
  20. Setscreen equ       5
  21. Setpalet  equ       6
  22. Setcolor  equ       7
  23. Giaccess  equ       28
  24. Xbtimer   equ       31
  25.  
  26. cr        equ       13
  27. lf        equ       10
  28. esc       equ       27
  29. gichip    equ       $ffff8800
  30. mfp       equ       $fffffa01
  31. isra      equ       14
  32. atimer    equ       0
  33. port_a    equ       15
  34.  
  35. PIXOVER   equ       3
  36. PIXDRAW   equ       2
  37. PIXSTART  equ       1
  38. WHITE     equ       0
  39. BLACK     equ       1
  40.  
  41. INIT      equ       $a000
  42. PUTPIXEL  equ       $a001
  43. intin     equ       8
  44. ptsin     equ       12
  45.  
  46. *----------------------------------*
  47. start
  48.      move.l    a7,a5
  49.      move.l    #my_stack,a7
  50.      move.l    4(a5),a5
  51.      move.l    $c(a5),d0
  52.      add.l     $14(a5),d0
  53.      add.l     $1c(a5),d0
  54.      add.l     #$100,d0
  55.      move.l    d0,-(sp)
  56.      move.l    a5,-(sp)
  57.      move      d0,-(sp)
  58.      move      #$4a,-(sp)
  59.      trap      #GEMDOS
  60.      add.l     #12,sp
  61.  
  62. *----------------------------------*
  63. _main
  64.      bsr       initialize
  65.      move.l    #titlemess,a0
  66.      bsr       message
  67.  
  68. *-  -  -  -  -  -  -  -  -  -  -  -*
  69. * Watch for any keystrokes. When
  70. *  encountered, decode keypress.
  71. mainloop
  72.      bsr       scankey
  73.      tst.l     d0
  74.      beq       mainloop
  75.  
  76.      bsr       decodekey
  77.      bra       mainloop
  78.  
  79. *----------------------------------*
  80. * Decide which key was pressed.
  81. decodekey
  82.      cmp.b     #"q",d0    Quit?
  83.      beq       terminate
  84.  
  85.      cmp.b     #"l",d0    Load?
  86.      beq       loadwefax
  87.  
  88.      cmp.b     #"s",d0    Save?
  89.      beq       savewefax
  90.  
  91.      cmp.b     #" ",d0    Toggle?
  92.      beq       togglescreen
  93.  
  94.      cmp.b     #"c",d0    Clear?
  95.      beq       clearscreen
  96.  
  97.      cmp.b     #"i",d0    Inverse?
  98.      beq       inverse_screen
  99.  
  100.      cmp.b     #"r",d0    Reset?
  101.      beq       doreset
  102.  
  103.      cmp.b     #"z",d0    Sleep?
  104.      beq       off_timer
  105.  
  106.      cmp.b     #".",d0    MoreTime?
  107.      beq       more_time
  108.  
  109.      cmp.b     #",",d0    LessTime?
  110.      beq       less_time
  111.  
  112.      cmp.b     #"1",d0    OneLine?
  113.      beq       oneline
  114.  
  115.      cmp.b     #"2",d0    TwoLine?
  116.      beq       twoline
  117.  
  118.      cmp.b     #"k",d0    LineSkip?
  119.      beq       newskip
  120.  
  121.      cmp.b     #"-",d0    LessCols?
  122.      beq       lesscolumns
  123.  
  124.      cmp.b     #"=",d0    MoreCols?
  125.      beq       morecolumns
  126.  
  127.      cmp.b     #"a",d0    AdjustSync?
  128.      beq       adjustsync
  129.  
  130.      rts
  131. *----------------------------------*
  132. adjustsync
  133.      move.w    #20,adjcount
  134.      rts
  135. *----------------------------------*
  136. newskip
  137.      move.w    colskip,d0
  138.      add.w     #1,d0
  139.      and.w     #3,d0
  140.      move.w    d0,colskip
  141.      rts
  142. *----------------------------------*
  143. * Erase the Fax Screen.
  144. clearscreen
  145.      move.w    #1,invmask
  146.      move.w    #8000,d0
  147.      move.l    org_screen,a0
  148. clsr1
  149.      clr.l     (a0)+
  150.      dbra      d0,clsr1
  151.  
  152.      rts
  153. *----------------------------------*
  154. * To generate a Fax Picture,
  155. *  1.) Initialize to the start
  156. *  2.) Refresh line skip amount
  157. *  3.) Set proper system status
  158. *  4.) Reset sync marker
  159. initfaxmap
  160.      move.w    #0,currrow
  161.      move.w    #0,currcol
  162.      move.w    colskip,skipcount
  163.      move.w    #PIXDRAW,status
  164.      move.w    #0,adjcount
  165.      rts
  166. *----------------------------------*
  167. getpoint
  168. * Pick up parallel port value in d0.
  169.      clr.l     d0
  170.      move.l    #gichip,a0
  171.      move.b    #15,(a0)
  172.      move.b    (a0),d0
  173.  
  174. * Is the HI bit set?
  175. * Branch if not, else load bit
  176.      and.b     #$80,d0
  177.      beq       plt0
  178.  
  179.      move.w    #1,d0
  180.      bra       plt01
  181.  
  182. * Hi bit set, load a zero.
  183. plt0
  184.      move.w    #0,d0
  185.  
  186. * Inverse dot request as needed
  187. * ...then copy to stack.
  188. plt01
  189.      move.w    invmask,d1
  190.      eor.w     d1,d0
  191.      move.l    d0,-(sp)
  192.  
  193. * Assume erasure wanted.
  194.      move.w    #WHITE,d2
  195.      bsr       plotpoint
  196.  
  197. * end part 1 of 6
  198. * 24Feb91/0201 Subject: wefax prg part 2 of 6 Bulletin ID: 4159_ON4ASX
  199. * Path: DB0CZ!OE9XPI!HB9EAS!DB0GE!LX0PAC!ON7RC!ON4HU!ON4ASX
  200. * From: ON4ASX@ON4ASX.BVWV.BEL.EU To  : ATARI@EU
  201. * part 2 of 6
  202.  
  203. * Recover dot request.
  204.      move.l    (sp)+,d0
  205.  
  206. * Should we replot it?
  207. * Branch if not.
  208.      tst.l     d0
  209.      beq       plt1
  210.  
  211. * Else replot the current dot.
  212.      move.w    #BLACK,d2
  213.      bsr       plotpoint
  214.  
  215. * Are we syncing to the left?
  216. * Branch if not, else delay by one.
  217. plt1
  218.      tst.w     adjcount
  219.      beq       process_point
  220.  
  221.      sub.w     #1,adjcount
  222.      rts
  223.  
  224. *-  -  -  -  -  -  -  -  -  -  -  -*
  225. * Bump one column to the right.
  226. * Have we plotted all columns?
  227. * Branch if yes, else split.
  228. process_point
  229.      add.w     #1,currcol
  230.      move.w    currcol,d0
  231.      move.w    numcol,d1
  232.      cmp.w     d1,d0
  233.      bge       pro2
  234.  
  235.      rts
  236.  
  237. *-  -  -  -  -  -  -  -  -  -  -  -*
  238. * Finished w/all columns in this row.
  239. * Reset to start of row.
  240. * Are we skipping lines?
  241. * Branch if not, else decrement count.
  242.  
  243. pro2
  244.      move.w    speedadj,adjcount
  245.      move.w    #0,currcol
  246.      tst.w     skipcount
  247.      beq       pro3
  248.  
  249.      sub.w     #1,skipcount
  250.      rts
  251.  
  252. *-  -  -  -  -  -  -  -  -  -  -  -*
  253. * Time for next line down.
  254. * Bump to next row down the screen.
  255. * Have we plotted all available rows?
  256. * Branch if not, else turn scan off.
  257. pro3
  258.      move.w    colskip,skipcount
  259.      add.w     #1,currrow
  260.      move.w    currrow,d0
  261.      move.w    numrow,d1
  262.      cmp.w     d0,d1
  263.      bgt       pro4
  264.  
  265.      move.w    #PIXOVER,status
  266. pro4
  267.      rts
  268.  
  269. *----------------------------------*
  270. *  This LINE-A point plotter
  271. * wants plotcolor->d2.
  272. plotpoint
  273.      move.w    currcol,d0
  274.      move.w    currrow,d1
  275.      move.l    mintin,a3
  276.      move.l    mptsin,a4
  277.      move.w    d0,(a4)
  278.      move.w    d1,2(a4)
  279.      move.w    d2,(a3)
  280.      dc.w      PUTPIXEL
  281.      rts
  282.  
  283. *----------------------------------*
  284. * Are we currently drawing a map?
  285. * Branch if not, else wait for the
  286. *   start of the next line, then init.
  287.  
  288. * Else start picture reception.
  289. doreset
  290.      bsr       show_fax
  291. dore1
  292.      move.w    status,d0
  293.      cmp.w     #PIXDRAW,d0
  294.      bne       getfaxmap
  295.  
  296.      tst.w     currcol
  297.      bne       dore1
  298.  
  299.      bra       initfaxmap
  300.  
  301. getfaxmap
  302.      move.w    #PIXSTART,status
  303.      bsr       on_timer
  304.      rts
  305.  
  306. *----------------------------------*
  307. * The interrupt routine itself.
  308. * if( not PIXOVER )then begin
  309. *      if( PIXSTART )then begin
  310. *         init FaxMap
  311. *      endif
  312. *      get, plot point
  313. * endif
  314. * clear interrupt in service
  315.  
  316. plotdata
  317.      movem.l   d0-a6,-(sp)
  318.  
  319.      move.w    status,d0
  320.      tst.w     d0
  321.      beq       plotexit
  322.  
  323.      cmp.w     #PIXOVER,d0
  324.      beq       plotexit
  325.  
  326.      cmp.w     #PIXSTART,d0
  327.      bne       plotfaxmap
  328.  
  329.      bsr       initfaxmap
  330. plotfaxmap
  331.      bsr       getpoint
  332. plotexit
  333.      move.l    #mfp,a1
  334.      bclr      #$5,isra(a1)
  335.  
  336.      movem.l   (sp)+,d0-a6
  337.      rte
  338.  
  339. *----------------------------------*
  340. * Start Timer A interrupting us.
  341. on_timer
  342.      move.l    #plotdata,-(sp)
  343.      move.w    timedata,-(sp)
  344.      move.w    timecontrol,-(sp)
  345.      move.w    #atimer,-(sp)
  346.      move.w    #Xbtimer,-(sp)
  347.      trap      #XBIOS
  348.      add.l     #12,sp
  349.      rts
  350.  
  351. *----------------------------------*
  352. * Stop Timer A from interrupting us.
  353. off_timer
  354.      move.w    #PIXOVER,status
  355.  
  356.      move.l    #plotdata,-(sp)
  357.      move.w    #0,-(sp)
  358.      move.w    #0,-(sp)
  359.      move.w    #atimer,-(sp)
  360.      move.w    #Xbtimer,-(sp)
  361.      trap      #XBIOS
  362.      add.l     #12,sp
  363.      rts
  364.  
  365. *----------------------------------*
  366. * Decrement number of columns.
  367. lesscolumns
  368.      move.w    numcol,d0
  369.      sub.w     #1,d0
  370.      cmp.w     #0,d0
  371.      bge       lsc1
  372.  
  373.      move.w    #0,d0
  374. lsc1
  375.      move.w    d0,numcol
  376.      rts
  377.  
  378. *----------------------------------*
  379. * Increment number of columns.
  380. morecolumns
  381.      move.w    numcol,d0
  382.      add.w     #1,d0
  383.      cmp.w     #1000,d0
  384.      blt       mcr1
  385.  
  386.      move.w    #1000,d0
  387. mcr1
  388.      move.w    d0,numcol
  389.      rts
  390. * end part 2 of 6
  391. * 24Feb91/0208 Subject: wefax part 3 of 6 Bulletin ID: 4160_ON4ASX
  392. * Path: DB0CZ!OE9XPI!HB9EAS!DB0GE!LX0PAC!ON7RC!ON4HU!ON4ASX
  393. * From: ON4ASX@ON4ASX.BVWV.BEL.EU  To  : ATARI@EU
  394. * part 3 of 6
  395.  
  396. *----------------------------------*
  397. * Insert default values for 1 LPS.
  398. oneline
  399.      bsr       off_timer
  400.      clr.l     d0
  401.      move.w    resolution,d0
  402.      move.l    #timed1_table,a0
  403.      asl.w     #1,d0
  404.      add.l     d0,a0
  405.  
  406.      move.w    #$05,timecontrol
  407.      move.w    (a0),timedata
  408.      bsr       on_timer
  409.      rts
  410.  
  411. *----------------------------------*
  412. * Insert default values for 2 LPS.
  413. twoline
  414.      bsr       off_timer
  415.      clr.l     d0
  416.      move.w    resolution,d0
  417.      move.l    #timed2_table,a0
  418.      asl.w     #1,d0
  419.      add.l     d0,a0
  420.  
  421.      move.w    #$05,timecontrol
  422.      move.w    (a0),timedata
  423.      bsr       on_timer
  424.      rts
  425.  
  426. *----------------------------------*
  427. more_time
  428.      move.w    timedata,d0
  429.      add.w     #1,d0
  430.      and.w     #255,d0
  431.      move.w    d0,timedata
  432.      bsr       on_timer
  433.      rts
  434.  
  435. *----------------------------------*
  436. less_time
  437.      move.w    timedata,d0
  438.      sub.w     #1,d0
  439.      and.w     #255,d0
  440.      move.w    d0,timedata
  441.      bsr       on_timer
  442.      rts
  443.  
  444. *----------------------------------*
  445. * Reverse the original screen.
  446. inverse_screen
  447.      move.w    #8000,d0
  448.      move.l    org_screen,a0
  449. invs1
  450.      move.l    (a0),d1
  451.      eor.l     #$ffffffff,d1
  452.      move.l    d1,(a0)+
  453.      dbra      d0,invs1
  454.  
  455.      move.w    invmask,d0
  456.      eor.w     #1,d0
  457.      move.w    d0,invmask
  458.      rts
  459.  
  460. *----------------------------------*
  461. togglescreen
  462.      bsr       off_timer
  463.      tst.w     whichscreen
  464.      bne       show_text
  465.  
  466. show_fax
  467.      move.w    #1,whichscreen
  468.      move.l    org_screen,a0
  469.      move.l    temp_screen,a1
  470.      bsr       movescreen
  471.  
  472.      move.l    fax_screen,a0
  473.      move.l    org_screen,a1
  474.      bsr       movescreen
  475.      rts
  476.  
  477. show_text
  478.      clr.w     whichscreen
  479.  
  480.      move.l    org_screen,a0
  481.      move.l    fax_screen,a1
  482.      bsr       movescreen
  483.  
  484.      move.l    temp_screen,a0
  485.      move.l    org_screen,a1
  486.      bsr       movescreen
  487.      rts
  488.  
  489. *----------------------------------*
  490. * Wants Source->a0, dest->a1.
  491. movescreen
  492.      move.w    #8000,d0
  493. mvs1
  494.      move.l    (a0)+,(a1)+
  495.      dbra      d0,mvs1
  496.  
  497.      rts
  498.  
  499. *----------------------------------*
  500. * Save a Wefax pix in DEGAS format.
  501. savewefax
  502.      bsr       deconfigure
  503.  
  504.      move.l    #savmes1,a0
  505.      bsr       message
  506.  
  507.      bsr       ask_for_file
  508.      tst.w     d0
  509.      beq       skipsav
  510.  
  511.      bsr       savefile
  512.      tst.w     d0
  513.      bmi       skipsav
  514.  
  515.      move.l    #sbufmes,a0
  516.      bsr       message
  517. skipsav
  518.      bsr       configure
  519.      rts
  520.  
  521. *-  -  -  -  -  -  -  -  -  -  -  -*
  522. savmes1
  523.      dc.b      cr,lf,"Save a"
  524.      dc.b      " Wefax Picture "
  525.      dc.b      "to disk.",cr,lf,0
  526.      even
  527.  
  528. sbufmes
  529.      dc.b      cr,lf,"Wefax Picture"
  530.      dc.b      " Saved.",cr,lf,0
  531.      even
  532.  
  533. *----------------------------------*
  534. * Load Wefax Pix in DEGAS format.
  535. loadwefax
  536.      bsr       deconfigure
  537.  
  538.      move.l    #l_mess1,a0
  539.      bsr       message
  540.  
  541.      bsr       ask_for_file
  542.      tst.w     d0
  543.      beq       lwfx
  544.  
  545.      bsr       loadfile
  546.      tst.w     d0
  547.      bmi       lwfx
  548.  
  549.      move.l    #l_mess2,a0
  550.      bsr       message
  551. lwfx
  552.      bsr       configure
  553.      rts
  554.  
  555. *-  -  -  -  -  -  -  -  -  -  -  -*
  556. l_mess1
  557.      dc.b      cr,lf,"Load a"
  558.      dc.b      " Wefax Picture from "
  559.      dc.b      "disk.",cr,lf,0
  560.      even
  561.  
  562. l_mess2
  563.      dc.b      cr,lf,"Wefax Picture "
  564.      dc.b      "loaded."cr,lf,0
  565.      even
  566.  
  567. *----------------------------------*
  568. ask_for_file
  569.      move.l    #file_mess,a0
  570.      bsr       message
  571.      bsr       getline
  572.      clr.l     d0
  573.      move.b    inbuff+1,d0
  574.      beq       endfile
  575.  
  576.      move.l    #filename,a0
  577.      move.l    #inbuff+2,a1
  578.      subq.w    #1,d0
  579. copyfn
  580.      move.b    (a1)+,(a0)+
  581.      dbra      d0,copyfn
  582.  
  583.      clr.b     (a0)+
  584.      moveq     #$ff,d0
  585. endfile
  586.      rts
  587.  
  588. *-  -  -  -  -  -  -  -  -  -  -  -*
  589. file_mess
  590.      dc.b      "Filename ?",0
  591.      even
  592.  
  593. * end part 3 of 6
  594. * 24Feb91/0215 Subject: wefax prg part 4 of 6 Bulletin ID: 4161_ON4ASX
  595. * Path: DB0CZ!OE9XPI!HB9EAS!DB0GE!LX0PAC!ON7RC!ON4HU!ON4ASX
  596. * From: ON4ASX@ON4ASX.BVWV.BEL.EU To  : ATARI@EU
  597. * part 4 of 6
  598.  
  599. *----------------------------------*
  600. loadfile
  601.      bsr       open_read
  602.      tst.l     d0
  603.      bmi       lof1
  604.  
  605.      bsr       read_file
  606.      bsr       close_file
  607.      move.l    #0,d0
  608.      bra       lofx
  609. lof1
  610.      move.l    #ld_mess,a0
  611.      bsr       message
  612.      move.l    #-1,d0
  613. lofx
  614.      rts
  615.  
  616. *----------------------------------*
  617. ld_mess
  618.      dc.b      cr,lf,"Error "
  619.      dc.b      "happened during "
  620.      dc.b      "load.",0
  621.      even
  622.  
  623. *----------------------------------*
  624. savefile
  625.      bsr       create_file
  626.      tst.l     d0
  627.      bpl       sfl1
  628.      bsr       open_write
  629.      tst.l     d0
  630.      bmi       sfl2
  631. sfl1
  632.      bsr       write_file
  633.      bsr       close_file
  634.      move.l    #0,d0
  635.      bra       sflx
  636. sfl2
  637.      move.l    #f_err_mess,a0
  638.      bsr       message
  639.      move.l    #-1,d0
  640. sflx
  641.      rts
  642.  
  643. *-  -  -  -  -  -  -  -  -  -  -  -*
  644. f_err_mess
  645.      dc.b      cr,lf,"Error, "
  646.      dc.b      "Picture was not "
  647.      dc.b      "saved.",0
  648.      even
  649.  
  650. *----------------------------------*
  651. create_file
  652.      move.w    #0,-(sp)
  653.      move.l    #filename,-(sp)
  654.      move.w    #$3c,-(sp)
  655.      trap      #GEMDOS
  656.      move.w    d0,handle
  657.      addq      #8,sp
  658.      rts
  659.  
  660. *----------------------------------*
  661. open_read
  662.      move.w    #0,-(sp)
  663.      move.l    #filename,-(sp)
  664.      move.w    #$3d,-(sp)
  665.      trap      #GEMDOS
  666.      move.w    d0,handle
  667.      addq.l    #8,sp
  668.      rts
  669. *----------------------------------*
  670. open_write
  671.      move.w    #1,-(sp)
  672.      move.l    #filename,-(sp)
  673.      move.w    #$3d,-(sp)
  674.      trap      #GEMDOS
  675.      move.w    d0,handle
  676.      addq.l    #8,sp
  677.      rts
  678.  
  679. *----------------------------------*
  680. read_file
  681.      move.l    #degas_buffer,-(sp)
  682.      move.l    #32034,-(sp)
  683.      move.w    handle,-(sp)
  684.      move.w    #$3f,-(sp)
  685.      trap      #GEMDOS
  686.      add.l     #12,sp
  687.  
  688. * Copy color palette to memory
  689.      move.w    #15,d0
  690. rf1
  691.      move.l    #new_palette,a0
  692.      move.l    #degas_buffer+2,a1
  693.      move.l    d0,d1
  694.      asl.w     d1
  695.      add.l     d1,a0
  696.      add.l     d1,a1
  697.      move.w    (a1),(a0)
  698.      dbra      d0,rf1
  699.  
  700. * Transfer screen
  701.      move.l    #degas_buffer+34,a0
  702.      move.l    fax_screen,a1
  703.      bsr       movescreen
  704.  
  705. * Activate new palette
  706.      move.l    #new_palette,-(sp)
  707.      move.w    #Setpalette,-(sp)
  708.      trap      #XBIOS
  709.      add.l     #6,sp
  710.  
  711.      rts
  712.  
  713. *----------------------------------*
  714. write_file
  715. *First copy resolution out.
  716.      move.w    resolution,degas_buffer
  717.  
  718. * Then copy color palette
  719.      move.w    #15,d0
  720. wf1
  721.      move.l    #new_palette,a0
  722.      move.l    #degas_buffer+2,a1
  723.      move.l    d0,d1
  724.      asl.w     d1
  725.      add.l     d1,a0
  726.      add.l     d1,a1
  727.      move.w    (a0),(a1)
  728.      dbra      d0,wf1
  729.  
  730. * Finally copy picture to buffer.
  731.      move.l    fax_screen,a0
  732.      move.l    #degas_buffer+34,a1
  733.      bsr       movescreen
  734.  
  735. * Now write picture information
  736.      move.l    #degas_buffer,-(sp)
  737.      move.l    #32034,-(sp)
  738.      move.w    handle,-(sp)
  739.      move.w    #$40,-(sp)
  740.      trap      #GEMDOS
  741.      add.l     #12,sp
  742.  
  743.      rts
  744.  
  745. *----------------------------------*
  746. close_file
  747.      move.w    handle,-(sp)
  748.      move.w    #$3e,-(sp)
  749.      trap      #GEMDOS
  750.      addq.l    #4,sp
  751.      rts
  752.  
  753. *----------------------------------*
  754. titlemess
  755.      dc.b      "--------------"
  756.      dc.b      "--------------",cr,lf
  757.      dc.b      "ST Facsimile R"
  758.      dc.b      "eproduction   "
  759.      dc.b      cr,lf,lf
  760.      dc.b      "(c)1986 Antic "
  761.      dc.b      "Pubishing     ",cr,lf
  762.      dc.b      "Written by Pat"
  763.      dc.b      "rick Bass",cr,lf
  764.      dc.b      "--------------"
  765.      dc.b      "--------------"
  766.      dc.b      cr,lf,0
  767.      even
  768. * end part 4 of 6
  769. * 24Feb91/0221 Subject: wefax prg part 5 of 6 Bulletin ID: 4162_ON4ASX
  770. * Path: DB0CZ!OE9XPI!HB9EAS!DB0GE!LX0PAC!ON7RC!ON4HU!ON4ASX
  771. * From: ON4ASX@ON4ASX.BVWV.BEL.EU To  : ATARI@EU
  772. * part 5 of 6
  773.  
  774. *----------------------------------*
  775. * Exit current program
  776. * and return to GEM/desktop...
  777. terminate
  778.      move.l    #org_palette,-(sp)
  779.      move.w    #Setpalette,-(sp)
  780.      trap      #XBIOS
  781.      addq.l    #6,sp
  782.  
  783.      bsr       off_timer
  784.      bsr       deconfigure
  785.  
  786.      move      #0,-(sp)
  787.      clr.l     d0
  788.      trap      #GEMDOS
  789.  
  790. * Whoops!
  791.      addq.l    #2,sp
  792.      rts
  793.  
  794. *----------------------------------*
  795. * Basic Initialization
  796. initialize
  797.  
  798. * First, init the Line-A interface
  799.      dc.w      INIT
  800.      move.l    a0,line_a
  801.      move.l    intin(a0),a3
  802.      move.l    ptsin(a0),a4
  803.      move.l    a3,mintin
  804.      move.l    a4,mptsin
  805.      
  806. * next, determine current rez.
  807.      move.w    #Getrez,-(sp)
  808.      trap      #XBIOS
  809.      addq      #2,sp
  810.      move.w    d0,resolution
  811.  
  812. * Now according to the resolution
  813. * we're in, set limits accordingly.
  814. * First, indexize d0, clear d1.
  815.      asl.w     #1,d0
  816.      clr.l     d1
  817.  
  818. * Get Bytes per line...
  819.      move.l    #bper,a0
  820.      adda.l    d0,a0
  821.      move.w    (a0),bperline
  822.  
  823. * Get screen width, height
  824.      move.l    #mxres,a0
  825.      adda.l    d0,a0
  826.      move.w    (a0),xres
  827.      move.w    (a0),numcol
  828.  
  829.      move.l    #myres,a0
  830.      adda.l    d0,a0
  831.      move.w    (a0),yres
  832.      move.w    (a0),numrow
  833.  
  834. * Now find our original screen,
  835. * and prepare space for two more.
  836.  
  837.      move.w    #Physbase,-(sp)
  838.      trap      #XBIOS
  839.      addq      #2,sp
  840.      move.l    d0,org_screen
  841.  
  842.      move.l    #fax_buffer,d0
  843.      and.l     #$ffff00,d0
  844.      add.l     #256,d0
  845.      move.l    d0,fax_screen
  846.  
  847.      move.l    #temp_buffer,d0
  848.      and.l     #$ffff00,d0
  849.      add.l     #256,d0
  850.      move.l    d0,temp_screen
  851.  
  852. * Init the parallel port for input.
  853.      bsr       configure
  854.  
  855. * Init Timer A values.
  856.      clr.l     d0
  857.      move.w    resolution,d0
  858.      asl.w     #1,d0
  859.      move.l    #timed2_table,a0
  860.      add.l     d0,a0
  861.      move.w    #$05,timecontrol
  862.      move.w    (a0),timedata
  863. * Create Palette
  864.      move.l    #15,d2
  865. init1
  866.      move.w    #-1,-(sp)
  867.      move      d2,-(sp)
  868.      move.w    #Setcolor,-(sp)
  869.      trap      #XBIOS
  870.      addq.l    #6,sp
  871.  
  872.      move.l    #org_palette,a0
  873.      move.l    #new_palette,a1
  874.      move.l    d2,d1
  875.      asl.w     #1,d1
  876.      adda.l    d1,a0
  877.      adda.l    d1,a1
  878.      move.w    d0,(a0)
  879.      move.w    d0,(a1)
  880.      dbra      d2,init1
  881.  
  882.      rts
  883.  
  884. *----------------------------------*
  885. configure
  886. * First, save state of ports now.
  887.      move.w    #$07,-(sp)
  888.      move.w    #0,-(sp)
  889.      move.w    #Giaccess,-(sp)
  890.      trap      #XBIOS
  891.      addq.l    #6,sp
  892.      move.w    d0,portstate
  893.  
  894. * Then configure Port B as input.
  895.      move.w    #$87,-(sp)
  896.      move.w    #$7f,-(sp)
  897.      move.w    #Giaccess,-(sp)
  898.      trap      #XBIOS
  899.      addq.l    #6,sp
  900.  
  901.      rts
  902.  
  903. *----------------------------------*
  904. deconfigure
  905.      move.w    #$87,-(sp)
  906.      move.w    portstate,-(sp)
  907.      move.w    #Giaccess,-(sp)
  908.      trap      #XBIOS
  909.      addq.l    #6,sp
  910.  
  911.      rts
  912.  
  913. *----------------------------------*
  914. * Prints up an a0 message.
  915. message
  916.      movem.l   d1/a0,-(sp)
  917.      clr.w     d1
  918. mess1
  919.      move.b    (a0)+,d1
  920.      beq       messx
  921.  
  922.      bsr       charout
  923.      bra       mess1
  924. messx
  925.      movem.l   (sp)+,d1/a0
  926.      rts
  927.  
  928. *----------------------------------*
  929. * Write character in d1 to console.
  930. charout
  931.      movem.l   d1-d7/a0-a6,-(sp)
  932.      move.w    d1,-(sp)
  933.      move.w    #2,-(sp)
  934.      trap      #GEMDOS
  935.      addq.l    #4,sp
  936.      movem.l   (sp)+,d1-d7/a0-a6
  937.      rts
  938.  
  939. end part 5 of 6
  940.  
  941.  
  942. part 6 of 6
  943. *----------------------------------*
  944. scankey
  945.      move.w    #$0b,-(sp)
  946.      trap      #GEMDOS
  947.      addq.l    #2,sp
  948.      tst.l     d0
  949.      bpl.s     skipkey
  950. getkey
  951.      move.w    #$07,-(sp)
  952.      trap      #GEMDOS
  953.      addq.l    #2,sp
  954.      rts
  955. skipkey
  956.      clr.l     d0
  957.      rts
  958.  
  959. *----------------------------------*
  960. * gets a line of text via BIOS
  961. getline
  962.      move.l    #inbuff,-(sp)
  963.      move.b    #32,inbuff
  964.      move.w    #$0a,-(sp)
  965.      trap      #GEMDOS
  966.      addq.l    #6,sp
  967.      rts
  968.  
  969. *----------------------------------*
  970. filename
  971.      dc.b      "filename.ext      "
  972.      even
  973.      dc.l    0,0,0,0,0,0,0,0,0,0,0,0
  974.  
  975. *----------------------------------*
  976. * Long words
  977. org_screen     ds.l       1
  978. fax_screen     ds.l       1
  979. temp_screen    ds.l       1
  980. line_a         ds.l       1
  981. mintin         ds.l       1
  982. mptsin         ds.l       1
  983.  
  984. * end part 5 of 6
  985. * 24Feb91/0226 Subject: wefax prg part 6 of 6 Bulletin ID: 4163_ON4ASX
  986. * Path: DB0CZ!OE9XPI!HB9EAS!DB0GE!LX0PAC!ON7RC!ON4HU!ON4ASX
  987. * From: ON4ASX@ON4ASX.BVWV.BEL.EU To  : ATARI@EU
  988. * part 6 of 6
  989.  
  990. *----------------------------------*
  991. * Words
  992. resolution     ds.w       1
  993. handle         ds.w       1
  994. xres           ds.w       1
  995. yres           ds.w       1
  996. numcol         ds.w       1
  997. numrow         ds.w       1
  998. currrow        ds.w       1
  999. currcol        ds.w       1
  1000. bperline       ds.w       1
  1001. status         ds.w       1
  1002. colmask        ds.w       1
  1003. adjcount       ds.w       1
  1004. skipcount      ds.w       1
  1005. whichscreen    ds.w       1
  1006. speedadj       ds.w       1
  1007. colskip        ds.w       1
  1008. invmask        ds.w       1
  1009. timedata       ds.w       1
  1010. timecontrol    ds.w       1
  1011. portstate      ds.w       1
  1012. portbyte       ds.w       1
  1013. org_palette    ds.w       16
  1014. new_palette    ds.w       16
  1015. bper           dc.w       160,160,80
  1016. mxres          dc.w       320,640,640
  1017. myres          dc.w       200,200,400
  1018. timed1_table   dc.w       120,60,60
  1019. timed2_table   dc.w       60,30,30
  1020.  
  1021. *-  -  -  -  -  -  -  -  -  -  -  -*
  1022.                bss
  1023.                ds.l       256
  1024. my_stack       ds.l       1
  1025. inbuff         ds.b       82
  1026.      even      
  1027. degas_buffer   ds.b       32767
  1028.      even
  1029. fax_buffer     ds.b       32767
  1030.      even
  1031. temp_buffer    ds.b       32767
  1032.      even
  1033.         end
  1034.  
  1035. * end part 6 of 6
  1036. * 73
  1037. * ASTUR   PB 46  B -8670 Koksijde Belgium
  1038.  
  1039.  
  1040.  
  1041.